import requests

# headers = {
#     'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36'}
# r = requests.get(
#     'https://www.baidu.com/s',
#     params={
#         "wd": "aaa"
#     },
#     headers=headers
# )
#
# print(r.status_code)
# r.encoding = 'utf-8'
# print(r.headers['Content-Type'])  # text/html
# print('*' * 30)
# print(r.encoding)
# print('*' * 30)
# print(r.text)
#
#
# r = requests.get("http://httpbin.org/ip")
# print(r.headers['Content-Type'])  # application/json
# d = r.json()
# print(d)
# print(type(d))


url = 'https://www.douban.com/'

headers = {
    'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36'
}

response = requests.get(
    url,
    headers=headers
)

print(response.status_code)
print('*****')
print(response.text)